import { createRouter, createWebHistory } from 'vue-router'
import { NotFoundPage, Redirect } from '@gyk/gyk-ui';


// 静态路由
export const constantRoutes: any[] = [
  {
    path: '/404',
    component: NotFoundPage,
  },
]


// 动态路由
export const dynamicRoutes: any[] = []

const router = createRouter({
  // createWebHistory就是vue2的history模式
  history: createWebHistory(),
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      savedPosition.left = 0
      savedPosition.top = 0
    }
  },
  routes: constantRoutes,
});

export default router
